package org.hikari.qqbot.xiuxian.configuration;

import cn.hutool.core.lang.Assert;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hikari.qqbot.xiuxian.service.bo.SystemSetting;
import org.springframework.beans.factory.InitializingBean;

/**
 * created at 2024-12-19 13:35:01
 *
 * @author yinchao
 * @version 1.0
 **/
@Getter
@Setter
@ToString
public class SystemSettingProperties extends SystemSetting implements InitializingBean {

    @Override
    public void afterPropertiesSet() throws Exception {
        Assert.notNull(getXiuXianBotId(), "缺少必要的配置项 'xiu-xian-bot-id'");
        Assert.notNull(getTaskHealthCheckIntervalSeconds(), "缺少必要的配置项 'task-health-check-interval-seconds'");
        Assert.notNull(getTaskHealthCheckWindowSeconds(), "缺少必要的配置项 'task-health-check-window-seconds'");
    }

}
